<!-- 轻资产-餐饮 -->
<template>
    <div class="zs-table-page-container">
      <HeaderProjectMonth :tabType="tabType" @onChange="changeTab" @onSearch="search">
      </HeaderProjectMonth>
      <TwoControlTableBudget v-show="tabType == 1 && tableListTwoControl && benchmarkType == 0"
        :tableList="tableListTwoControl" :yearmonth="yearmonth" :isFresh="isFresh">
      </TwoControlTableBudget>
      <TwoControlTableStandard v-show="tabType == 1 && tableListTwoControl && benchmarkType == 1"
        :tableList="tableListTwoControl" :yearmonth="yearmonth" :isFresh="isFresh">
      </TwoControlTableStandard>
    </div>
  </template>
  <script setup>
  import HeaderProjectMonth from '@/views/SpecialReport/lightAssetCatering/components/headerProjectMonth'
  import TwoControlTableBudget from '@/views/SpecialReport/lightAssetExtConBudget/components/twoControlTableBudget'
  import TwoControlTableStandard from '@/views/SpecialReport/lightAssetExtConBudget/components/twoControlTableStandard'
  import { twoCalProManageListApi } from '@/api/SpecialReport/twoControl';
  import { ref } from 'vue'
  // tabType 右侧tab： 1 两算一控 2 财务口径
  const tabType = ref(1)
  const changeTab = (data) => {
    tabType.value = data.data
  }
  
  const isFresh = ref('');
  const yearmonth = ref('');
  const benchmarkType = ref('')
  const tableListTwoControl = ref([])
  
  const search = async (data) => {
    yearmonth.value = data.yearmonth
    benchmarkType.value = data.benchmarkType
  
    await twoCalProManageListApi(data).then(res => {
      if (res.data.code == 200) {
        tableListTwoControl.value = res.data.data
      }
    })
    isFresh.value = new Date().getTime();
  }
  </script>
  
  <style scoped lang="scss"></style>
  